<template>
    <div class="gradient-bg">
        <div class="login-box">
            <div class="login-header">请你登录</div>
            <div class="form-content">
                <input type="text" v-model="username" name="username" placeholder="账号" class="input-field">
                <input type="password" v-model="password" name="password" placeholder="密码" class="input-field">
                <div class="login-button" @click="clickLogin">登录</div>
            </div>
        </div>
    </div>
    <a href="https://beian.miit.gov.cn/" class="footer" @click="clickPrepare">川公网安备 蜀ICP备2023013167号</a>
</template>

<script setup>
import { ref } from 'vue';
import { $_login } from "@/api/user";

const username = ref('');
const password = ref('');
const clickLogin = () => {
    $_login({
        username: username.value,
        password: password.value
    }).then(res => {
        console.log(res);
    })
}
</script>

<style lang="scss" scoped>
.gradient-bg {
    height: 100%;
    background-image: linear-gradient(to right, #fbc2eb, #a6c1ee);
}

.login-box {
    background-color: #fff;
    width: 358px;
    height: 588px;
    border-radius: 15px;
    padding: 0 50px;
    position: relative;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.login-header {
    font-size: 38px;
    font-weight: bold;
    text-align: center;
    line-height: 200px;
}

.input-field {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    border: 0;
    padding: 10px;
    border-bottom: 1px solid rgb(128, 125, 125);
    font-size: 15px;
    outline: none;
}

.input-field::placeholder {
    text-transform: uppercase;
}

.login-button {
    text-align: center;
    padding: 10px;
    width: 100%;
    margin-top: 40px;
    background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
    color: #fff;
    border-radius: 8px;
}

a {
    text-decoration-line: none;
    color: #abc1ee;
}
.footer{
    position: fixed;
    font-size: 12px;
    bottom: 0;
    left: 50%;
    transform: translate(-50%);
    color: red;
}
</style>